<P>This page demonstrates the features of all the 5 validation controls and the
ValidationSummary control.</P>
<P><asp:validationsummary id="ValidationSummary1" runat="server" Height="83px" HeaderText="Please correct the following errors" EnableViewState="False" ShowMessageBox="True" Width="501px"></asp:validationsummary></P>
<P><asp:label id="Label1" runat="server">Name (required)</asp:label><asp:textbox id="txtUserName" runat="server" Width="135px"></asp:textbox><asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" ControlToValidate="txtUserName">The name is required !</asp:requiredfieldvalidator></P>
<P><asp:label id="Label2" runat="server">Year Born (1901-2000)</asp:label><asp:textbox id="txtYearBorn" runat="server" Width="88px"></asp:textbox><asp:rangevalidator id="RangeValidator1" runat="server" ControlToValidate="txtYearBorn" Type="Integer" MaximumValue="2000" MinimumValue="1901" ErrorMessage="The Year Born field must be in the range [1901-2000]">*</asp:rangevalidator> <asp:label id="Label3" runat="server">Year married (> year born)</asp:label><asp:textbox id="txtYearMarried" runat="server" Width="69px"></asp:textbox><asp:comparevalidator id="CompareValidator1" runat="server" ControlToValidate="txtYearMarried" ErrorMessage="The Year Married field must be later than the Year Born field" Operator="GreaterThan" ControlToCompare="txtYearBorn">*</asp:comparevalidator></P>
<P><asp:label id="Label7" runat="server">Date of last visit</asp:label><asp:textbox id="txtLastVisit" runat="server" Width="143px"></asp:textbox><asp:comparevalidator id="CompareValidator2" runat="server" ControlToValidate="txtLastVisit" Type="Date" ErrorMessage="Date of last visit isn't valid" Operator="DataTypeCheck">*</asp:comparevalidator> <asp:label id="Label8" runat="server">Number of Children (>= 0)</asp:label><asp:textbox id="txtChildren" runat="server" Width="94px"></asp:textbox><asp:comparevalidator id="CompareValidator3" runat="server" ControlToValidate="txtChildren" Type="Integer" ErrorMessage="Number of Children must be an integer >= zero" Operator="GreaterThan" ValueToCompare="0">*</asp:comparevalidator></P>
<P><asp:label id="Label4" runat="server">Phone number </asp:label><asp:textbox id="txtPhoneNumber" runat="server"></asp:textbox><asp:regularexpressionvalidator id="RegularExpressionValidator1" runat="server" ControlToValidate="txtPhoneNumber" ErrorMessage="The Phone Number must be in (###)###-#### format">*</asp:regularexpressionvalidator></P>
<P><asp:label id="Label5" runat="server">An even number</asp:label><asp:textbox id="txtEvenNumber" runat="server" Width="143px"></asp:textbox><asp:customvalidator id="CustomValidator1" runat="server" ControlToValidate="txtEvenNumber" ErrorMessage="Enter an even value" ClientValidationFunction="CheckEvenNumber">*</asp:customvalidator>